import pytest
import requests


@pytest.fixture(scope="session")
def login():
    url = "https://test.51ztb.com/accv3/account/login"
    data = {"devType": "P", "account": "15737133002", "password": "123456"}
    headers = {"Content-Type": "application/json"}
    response = requests.post(url, json=data, headers=headers)
    auth = response.json()["results"]["account"] + "_" + response.json()["results"]["token"]
    print(auth)
    yield auth
    print("退出登录")


